<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js-encode</title>
    <script type="text/javascript" src="../../../DjangoBootstrap/static/js/currenttime.js"></script>

    <script type="text/javascript" src = "../../../DjangoBootstrap/static/bootstrap/3.3.7/js/jquery-2.1.1.min.js"></script>

    <script type="text/javascript">
        function compile(code) {
           var c=String.fromCharCode(code.charCodeAt(0)+code.length);
           for(var i=1;i<code.length;i++){
           c+=String.fromCharCode(code.charCodeAt(i)+code.charCodeAt(i-1));
           }
           alert(escape(c));
        }

        function uncompile(code) {
           code=unescape(code);
           var c=String.fromCharCode(code.charCodeAt(0)-code.length);
           for(var i=1;i<code.length;i++){
           c+=String.fromCharCode(code.charCodeAt(i)-c.charCodeAt(i-1));
           }
           return c;
        }

        if(0) {
            window.onload = function () {
                document.onkeydown = function () {
                    var e = window.event || arguments[0];
                    if (e.keyCode == 123) {/*屏蔽F12*/
                        alert("小样你想干嘛？");
                        return false;
                    } else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode == 73)) {
                        alert("还是不给你看。。");
                        return false; /*屏蔽crtl+shift+i*/
                    }
                };
                /*鼠标右键屏蔽*/
                document.oncontextmenu = function () {
                    alert("小样不给你看");
                    return false;
                }
            }
        }

        $(document).ready(function () {
            var start = Number(new Date());
            /**
            while(start + 5000 > Number(new Date())) {//执行JS}
                //这段代码将使JS执行5秒才完成！
                $("#current_time").text(getCurrentTime());
            }
             */

            $("#current_time").text(getCurrentTime());
            //compile("alert('加密测试!');");//https://blog.csdn.net/doulinxu/article/details/60766242
            eval(uncompile('p%CD%D1%D7%E6%9CO%u52C7%uAE66%uC911%uF920%u8BF6HPd'));
        });

    </script>
</head>
<body>
    <div>
        <h1>这是一个测试</h1>
        <p>js加密成功了吗</p>
        <p id="current_time">时间</p>
    </div>
</body>
</html>